package com.wzq.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wzq.controller.admin.GetSome;
import com.wzq.dao.pojo.*;
import com.wzq.service.ITimeSelectionService;
import com.wzq.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 后台管理-用户Controller控制器
 */
@RestController
@RequestMapping("/timeselection")
public class TimeselectionController extends GetSome {
    @Autowired
    private ITimeSelectionService iTimeselectionService;

    @GetMapping("/{w_id}")            //单个回显
    public Result findById(@PathVariable Integer w_id){
        TimeSelection timeselection = iTimeselectionService.getOne(new LambdaQueryWrapper<TimeSelection>().eq(TimeSelection::getW_id,w_id));
        //        获得用户名称和项目名称
        return new Result(Code.GET_OK,timeselection,"success");
    }

    @RequestMapping("/listAll")
    public R listAll(){
        Map<String,Object> map=new HashMap<>();
        map.put("TimeSelection",iTimeselectionService.list());
        return R.ok(map);
    }


}
